package com.zmn.oms.model.entity.work.list;

import com.zmn.oms.model.entity.work.OrderBaseEsQuery;
import com.zmn.oms.model.es.ZmnEsFieldType;
import com.zmn.oms.model.es.ZmnToEs;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.List;

/**
 * 类描述： 商家后台
 *
 * @author yule
 * @date 2019/04/10 15:01
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class OrderWorkChannelQuery extends OrderBaseEsQuery {

	/**
	 * 工单类型
	 * @see com.zmn.oms.common.constant.OrderConsts#getOrderWorkTypeList()
	 */
	@ZmnToEs(map = "type", type = ZmnEsFieldType.Arr)
	private List<Integer> workType;

    /**
     * 渠道id
     */
    @ZmnToEs(map = "channelId", type = ZmnEsFieldType.Integer)
    private Integer channelId;

    /**
     * 来源渠道id
     */
    @ZmnToEs(map = "sourceChannelId", type = ZmnEsFieldType.Integer)
    private Integer sourceChannelId;

	/**
	 * 省份id
	 */
	@ZmnToEs(map = "provinceId", type = ZmnEsFieldType.Integer)
	private Integer provinceId;

	/**
	 * 城市id
	 */
	@ZmnToEs(map = "cityId", type = ZmnEsFieldType.Integer)
	private Integer cityId;

    /**
     * 用户名 （客户名称 ？ ）
     */
    @ZmnToEs(map = "contact.userName", type = ZmnEsFieldType.Text)
    private String userName;

    /**
     * 大客户Id 集合 （维保管家  根据管家查出所管大客户Id集合查询）
     */
    @ZmnToEs(map = "userId", type = ZmnEsFieldType.Arr)
    private List<Long> userIdList;

    /**
     * 订单号
     */
    @ZmnToEs(map = {"id", "codeEnd6"}, type = ZmnEsFieldType.Or)
    private String code;

    /**
     * 联系人
     */
    @ZmnToEs(map = "contact.contactName", type = ZmnEsFieldType.Text)
    private String contactName;

    /**
     * 联系电话
     */
    // @ZmnToEs(map = {"contact.queryPhone", "contact.phoneEnd4"}, type = ZmnEsFieldType.Or)
    private String telephone;

	/**
	 * 工单状态
	 */
	@ZmnToEs(map = "status", type = ZmnEsFieldType.Arr)
	private List<Integer> statusList;

	/**
	 * 工单结果状态
	 */
	@ZmnToEs(map = "resultStatus", type = ZmnEsFieldType.Arr)
	private List<Integer> resultStatus;


    /**
     * 订单来源类型
     */
    @ZmnToEs(map = "sourceType", type = ZmnEsFieldType.Integer)
    private Integer sourceType;

    /**
     * 下单时间 格式 startTime,endTime
     */
    @ZmnToEs(map = "receiveTime", type = ZmnEsFieldType.Date)
    private String receiveTime;

    /**
     * 完成时间 格式 startTime,endTime
     */
    @ZmnToEs(map = "completeTime", type = ZmnEsFieldType.Date)
    private String completeTime;

    /**
     * 完成时间 1否 2是
     */
    @ZmnToEs(map = "completeTime", type = ZmnEsFieldType.Exist)
    private Integer existCompleteTime;

    /**
     * 可结算时间 1否 2是
     */
    @ZmnToEs(map = "channelStatementCanTime", type = ZmnEsFieldType.Exist)
    private Integer existChannelStatementCanTime;

    /**
     * 不包含标签id
     */
    @ZmnToEs(map = "orderTagList.tagId", type = ZmnEsFieldType.NotIn)
    private Integer nonTagId;

}
